package com.atguigu.flink.chapter05.transform.partition;

import org.apache.flink.api.common.functions.Partitioner;

import java.util.Random;

/**
 * @Author lzc
 * @Date 2023/6/19 11:48
 */
public class MyPartitioner implements Partitioner<String> {
    
    @Override
    public int partition(String key, int numPartitions) {
        return new Random().nextInt(numPartitions);
    }
}
